package com.config;

import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 还可以自定义Feign的编码器，解码器，日志打印、甚至为Feign添加拦截器。
 * 例如一些借口需要进行基于Http Basic的认证后才能调用
 * Date 2018/06/28
 *
 * @author MT-Lin
 */
@SuppressWarnings("ALL")
@Configuration
public class FooConfiguration {

    @Bean
    public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
        return new BasicAuthRequestInterceptor("username", "password");
    }
}
